<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="initial-scale=1, user-scalable=0, minimal-ui" charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="css/index.css" />
		<link rel="stylesheet" href="css/swiper.css" />
		<link rel="stylesheet" href="css/mint.css">
		<link rel="stylesheet" href="css/mint-style.css">
		 <script src="js/vue_resource.js"></script>
	</head>
		<script src="js/serverUrl.js"></script>
		<script src="js/vue.js"></script>
		<script src="js/mint.js"></script>
		<script src="js/moment.js"></script>
		<style type="text/css">
			.conclusionContainer{
				display: flex;
				flex-direction: column;
				width: 100vw;
				background: white;
			}
			.detailTitle{
				width: 100vw;
				display: flex;
				justify-content: center;
				font-size: 18px;
				padding-top: 5px;
				padding-bottom: 5px;
			}
			
			.infoContainer{
				display: flex;
				justify-content: space-between;
				align-items: center;
				padding-left: 15px;
				padding-right: 15px;
				font-size: 16px;
				padding-top: 10px;
				padding-bottom: 10px;
				border-top: 1px solid #e0e0e0;
			}
			.content{
				font-size: 14px;
				background-color: #f0f0f0;
				margin:0px 10px 10px 10px;
				padding: 5px;
				border-radius: 5px;
				white-space: pre-line;
			}

		</style>
	<body style="background-color: #f0f0f0;">
		<div id="app">
			<div class="conclusionContainer">
				<div class="detailTitle">{{trainingClass.realClassName}}</div>
				<div class="infoContainer"><span>培训编号</span><span>{{trainingClass.professionalClassName}}</span></div>
				<div class="infoContainer"><span>培训日期</span> <span>{{trainingClass.startDate| formatTime}}</span></div>
                <div class="infoContainer" style="border-top: 0px solid #e0e0e0;"><span></span> <span>{{trainingClass.endDate| formatTime}}</span></div>
                <div class="infoContainer"><span>主办机构</span> <span>{{trainingClass.organizer}}</span></div>
			</div>
			
			<div class="conclusionContainer" style="margin-top: 15px;">
                <div class="infoContainer"><span>项目类别</span><span>{{trainTypeValue}}</span></div>
                <div class="infoContainer"><span>培训级别</span><span>{{classLevelValue}}</span></div>
                <div class="infoContainer"><span>培训模式</span><span>{{classModeValue}}</span></div>
                <div class="infoContainer"><span>培训期数</span><span>{{trainingClass.teamNum}}</span></div>
			</div>
		</div>
	</body>
	
	<script type="text/javascript">
		var app = new Vue({
		  el: '#app',
		  data:{
			  trainingClass: {
			  },
			  trainTypeValue: '',
			  classLevelValue: '',
			  classModeValue: '',
			  trainTypeList: [],
			  trainLevelList: [],
			  trainModeList: [],
		  },
		  filters:{
			  formatTime (val) {
				return moment(val).format("YYYY年MM月DD日")
			  }
		  },
		  created() {
              window.getTrainingClass = this.getTrainingClass
		  },
		  methods:{
			  //方法：
			  selectDictLabel(datas, value) {//datas放数组 //value放值
				  var actions = [];
				  Object.keys(datas).some((key) => {
					  if (datas[key].value == ('' + value)) { //dictValue为数据的值
						  actions.push(datas[key].label);//dictLabel为数据的id
						  return true;
					  }
				  })
				  return actions.join('');
			  },
			  //调用案例
			  //let res = this.selectDictLabel(this.deptList, 2)

			  getTrainingClass (trainingClass){
				this.trainingClass = trainingClass;
				this.trainTypeList = [{value: 1,label:'岗位培训'},{value:2,label:'技能培训'},{value:3,label:'安全培训'},{value:4,label:'素质培训'}];
				this.trainLevelList = [{value: 1,label:'晋能集团'},{value:2,label:'二级公司'},{value:3,label:'公司内训'}];
				this.trainModeList = [{value: 1,label:'面授学习'},{value:2,label:'在线学习'},{value:3,label:'外派学习'},{value:4,label:'组织活动'}];
                this.trainTypeValue = this.selectDictLabel(this.trainTypeList,trainingClass.professionalClassType);
				this.classLevelValue = this.selectDictLabel(this.trainLevelList,trainingClass.professionalClassLevel);
				this.classModeValue = this.selectDictLabel(this.trainModeList,trainingClass.professionalClassMode);
			  },
              toFileList () {
                  let params = {
                      fileList:this.trainingClass.fileList
                  }
                  
                  WebViewJavascriptBridge.callHandler('toFileList',params,function(response) {
                                        
                  });
              },
			  toNewsDetail (dataId){
				alert(dataId)  
			  }
		  }
		})		
		</script>
</html>
